package com.alibaba.dingtalk.openapi.message;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.toolbox.util.StringUtil;

/**
 * @author dingtalk
 */
public class LightAppMessageDelivery extends MessageDelivery {

	public String touser;
	public String toparty;
	public String agentid;
	public String corpid;
	public Integer type;
	
	public String code;
	
	public LightAppMessageDelivery() {
	}
	
	public LightAppMessageDelivery(String toUsers, String toParties, String agentId) {
		this.touser = toUsers;
		this.toparty = toParties;
		this.agentid = agentId;
	}
	
	
	
	public String getCorpid() {
		return corpid;
	}



	public void setCorpid(String corpid) {
		this.corpid = corpid;
	}



	public Integer getType() {
		return type;
	}



	public void setType(Integer type) {
		this.type = type;
	}



	@Override
	public JSONObject toJsonObject() {
		JSONObject json = super.toJsonObject();
		json.put("touser", this.touser);
		json.put("toparty", this.toparty);
		json.put("agentid", this.agentid);
		
		if(!StringUtil.isEmpty(code)) {
			json.put("code", this.code);
		}
		return json;
	}
}
